package offer;

import java.util.Arrays;

/**
 * @Author Elephas
 * @Date 2022/1/30
 **/
@FunctionalInterface
public interface FindFinalValue {
    int findFinalValue(int[] nums,int original);
}
class FindFinalValueImpl1 implements FindFinalValue{

    @Override

    public int findFinalValue(int[] nums, int original) {
        Arrays.sort(nums);
        for (int i = 0; i < nums.length; i++) {
            if(nums[i] == original){
                original *= 2;
            }
        }
        return original;
    }
}
